package tn.talan.poi;
import java.io.*;
import org.apache.poi.hssf.usermodel.*;
import org.apache.poi.poifs.filesystem.*;
import org.apache.poi.hssf.usermodel.HSSFRow;
import org.apache.poi.hssf.eventusermodel.*;
import org.apache.poi.hssf.record.*;
//import org.apache.poi.hssf.dev.EFHSSF;
public class findrecordtest {
public static void main(String[] args) throws IOException
  {
  FileInputStream fis = new FileInputStream(args[0]);
  POIFSFileSystem pfs = new POIFSFileSystem(fis);
  InputStream in = pfs.createDocumentInputStream
("Workbook");
  HSSFRequest hreq = new HSSFRequest();
 hreq.addListenerForAllRecords((HSSFListener) new findrecordtest());
 HSSFEventFactory factory = new HSSFEventFactory();
  factory.processEvents(hreq, in);
  fis.close();
 in.close();
  System.out.println("STOP");
  }
  public void processRecord(Record record)
  {
  switch (record.getSid())  {
  case  RowRecord.sid:
  RowRecord rowrececord = (RowRecord) record;
  System.out.println("Row is found, First column at "
  + rowrececord.getFirstCol() + 
" Last column at " + rowrececord.getLastCol());
  break; 
  }
 }  
}
